// These are meant to be typed into the REPL. You can also run
// scala -Xnojline < repl-session.scala to run them all at once.

import scala.math._

/**
 *
 * @param f (Double) => Double 入参：Double 返回值：Double
 * @return
 */
def valueAtOneQuarter(f: (Double) => Double) = f(0.25)

valueAtOneQuarter(ceil _)
valueAtOneQuarter(sqrt _)

// 产出函数（也就是闭包函数）
def mulBy(factor : Double) = (x : Double) => factor * x

val quintuple = mulBy(5)
quintuple(20)

